package com.ohuang.demo.storage

import android.content.Context


/**
 * 通过sp存数据
 */
class SpStorage2<T>(val context: Context, val spUtil: SPUtil, val defaultValue:T):
    IStorage2<T> {
    override fun getValue(name: String): T {
        return spUtil.get(context, name, defaultValue) as T
    }

    override fun setValue(name: String, value: T) {
        spUtil.put(context, name, value)
    }
}